{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# GRAPH_RECURSION_LIMIT\n",
    "\n",
    "Your LangGraph [`StateGraph`](https://langchain-ai.github.io/langgraphjs/reference/classes/langgraph.StateGraph.html) reached the maximum number of steps before hitting a stop condition.\n",
    "This is often due to an infinite loop caused by code like the example below:\n",
    "\n",
    "```ts\n",
    "const graph = new StateGraph(...)\n",
    "  .addNode(\"a\", ...)\n",
    "  .addNode(\"b\", ...)\n",
    "  .addEdge(\"a\", \"b\")\n",
    "  .addEdge(\"b\", \"a\")\n",
    "  ...\n",
    "  .compile();\n",
    "```\n",
    "\n",
    "However, complex graphs may hit the default limit naturally.\n",
    "\n",
    "## Troubleshooting\n",
    "\n",
    "- If you are not expecting your graph to go through many iterations, you likely have a cycle. Check your logic for infinite loops.\n",
    "- If you have a complex graph, you can pass in a higher `recursionLimit` value into your `config` object when invoking your graph like this:\n",
    "\n",
    "```ts\n",
    "await graph.invoke({...}, { recursionLimit: 100 });\n",
    "```\n"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
